package com.karolak.stock.indicator;

import java.text.DecimalFormat;

public class HorizontalInd extends Indicator {

	private double y;

	public HorizontalInd(double value) {
		super(null, 0, null);
		this.y = value;
		DecimalFormat df = new DecimalFormat("0.0000");
		setName(String.format("%s(%s)", super.getName(), df.format(getY())));
	}

	public HorizontalInd(String name, double value) {
		this(value);
		setName(name);
	}

	public double execute(double x) {
		return getY();
	}

	public double getY() {
		return y;
	}
}
